<%@page import="com.windfone.common.Constant"%>
<%@ page language="java" contentType="text/html; charset=utf-8"    pageEncoding="utf-8"%>
<%@include file="header.jsp"%>
<style type="text/css">
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.STYLE1 {
	color: #666666;
	font-weight: bold;
}
.STYLE5 {color: #666666}
.STYLE6 {
	color: #135294;
	font-weight: bold;
}
</style>
<script>
function checkAndSubmit(){
	var form = document.getElementById("addColorForm");
	form.submit();
}
function setValue(id,name){
	$("#colorName").val(name);
	$("#colorId").val(id);
	$("#tijiao").val("更新");
	$("#operateType").val("update");
}

</script>
<div align="center">颜色列表</div>
 <table width="95%"  border="0" cellpadding="3" cellspacing="2" bgcolor="#FFFFFF" align="center">
   <tr>
     <td nowrap background="images/bg_table.jpg" bgcolor="#ECEAE6">名称</td>
     <td nowrap background="images/bg_table.jpg" bgcolor="#ECEAE6">操作</td>
   </tr>
   <s:iterator value="colors">
     <tr bgcolor='#F1F3F5' onmouseover = "this.style.backgroundColor = '#FFDCB0'" onmouseout = "this.style.backgroundColor = ''" style='cursor:hand'>
       <td><s:property value="colorName"/></td>
       <td>
       <a href="#" onclick="setValue(<s:property value='id'/>,'<s:property value='colorName'/>')">编辑</a> 
       <a href="deleteColor.action?colorId=<s:property value='id'/>&productId=<s:property value='productId'/>" onclick="javascript:if(confirm('确定删除颜色吗')) return true; else return false;">删除</a> </td>
     </tr>
   </s:iterator>
   <tr>
     <td colspan="2" nowrap  bgcolor='#E4EDF9'>
     	<form method="post" action="color.action" id="addColorForm">
     		颜色:<input type="text" name="colorName" id="colorName"/>
     		<input type="hidden" name="productId"  value="<s:property value='productId'/>"/>
     		<input type="hidden" name="colorId"  id="colorId" value="0"/>
     		<input type="hidden" name="operateType" id="operateType"  value="Add"/>
     		<input type="hidden" name="colorTypeId" value="<%=Constant.COLOR_TYPE_PRODUCT %>"/>
     		<input type="button" name="tijiao" id="tijiao" value="新增" onclick="checkAndSubmit()"/>&nbsp;
     		<input type="reset" name="resetName"  id="resetName"/>
     		<input type="button" name="return"  value="返回" onclick="javascript:window.location.href='productList.action';"/>
     	</form>
     </td>
   </tr>
   <tr/> 
</table>
 